import request from '@/utils/request'
export default{
  saveAndCommit(courseInfo) {
    return request({
      url: 'admin/edu/course/save-course-info',
      method: 'POST',
      data: courseInfo
    })
  },
  // 根据ID查询课程的相关信息
  getCourseById(id) {
    return request({
      url: `admin/edu/course/getCourseById/${id}`,
      method: 'GET'
    })
  },
  // 根据id和待修改的值进行修改
  editCourse(id, courseInfo) {
    return request({
      url: `admin/edu/course/editCourseInfo/${id}`,
      method: 'PUT',
      data: courseInfo
    })
  },
  // 获取courseLIST列表信息
  getList(pageNum, pageSize, courseSelect) {
    return request({
      url: `http://localhost:9110/admin/edu/course/getPageCount/${pageNum}/${pageSize}`,
      method: 'get',
      params: courseSelect
    })
  },
  // 根据id发布
  publishCourseById(id) {
    return request({
      url: `admin/edu/course/publishCourse/${id}`,
      method: 'POST'
    })
  },
  // 根据id获取对应课程的详细信息
  getCourseInfoById(id) {
    return request({
      url: `admin/edu/course/getPublishById/${id}`,
      method: 'get'
    })
  }

}
